﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace dogd.WalkingSkeleton
{
	[Table("Album")]
	public class Album
	{
		public Album()
		{
			this.PrimaryKey = new Key();
			this.ForeignKey = new Key();
		}

		public Album(string name, int year, Band band)
			:this()
		{
			this.Name = name;
			this.Year = year;
			this.ForeignKey = new Key(band.PrimaryKey.Value);
		}

		[PrimaryKeyColumn("AlbumID")]
		public int DbKey
		{
			get { return this.PrimaryKey.Value; }
			set { this.PrimaryKey.Value = value; }
		}

		[ForeignKeyColumn("BandID")]
		public int BandDbKey
		{
			get { return this.ForeignKey.Value; }
			set { this.ForeignKey.Value = value; }
		}

		[Column("Name")]
		public string Name
		{
			get;
			set;
		}

		[IntegerColumn("ReleaseYear")]
		public int Year
		{
			get;
			set;
		}

		public Key PrimaryKey
		{
			get;
			set;
		}

		public Key ForeignKey
		{
			get;
			set;
		}
	}
}
